﻿// Decompiled with JetBrains decompiler
// Type: Netick.Monitor
// Assembly: Netick, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
// MVID: 6726ECA1-C773-4CF7-8952-E81B30D93B52
// Assembly location: D:\WorkSpaceDemo\UPM\NetickForUnity\Netick\Runtime\Netick.dll
// XML documentation location: D:\WorkSpaceDemo\UPM\NetickForUnity\Netick\Runtime\Netick.xml

#nullable disable
namespace Netick;

public sealed class Monitor
{
  public readonly FloatStats FPS;
  public readonly FloatStats ServerTickTime;
  public readonly FloatStats RTT;
  public readonly FloatStats Resimulations;
  public readonly FloatStats SnapshotSize;
  public readonly NetickProfiler UpdateEntryPoint;
  public readonly NetickProfiler SendProfiler;
  public readonly NetickProfiler ReceiveProfiler;
  public readonly NetickProfiler ProcessStateChangesProfiler;
  public readonly NetickProfiler TickProfiler;
  public readonly NetickProfiler GameEngineIntoNetcodeProfiler;
  public readonly NetickProfiler NetcodeIntoGameEngineProfiler;
  public readonly NetickProfiler ResimulateProfiler;
  public readonly NetickProfiler UpdateProfiler;
  public readonly NetickProfiler FixedUpdateProfiler;
  public readonly NetickProfiler RenderProfiler;

  internal Monitor(NetickEngine engine)
  {
    this.FPS = new FloatStats((int) engine.Config.TickRate);
    this.ServerTickTime = new FloatStats((int) engine.Config.TickRate);
    this.RTT = new FloatStats((int) engine.Config.TickRate);
    this.Resimulations = new FloatStats((int) engine.Config.TickRate);
    this.SnapshotSize = new FloatStats((int) engine.Config.TickRate);
    if (!engine.IsProfilingEnabled)
      return;
    this.UpdateEntryPoint = new NetickProfiler(engine.Name + ":UpdateEntryPoint");
    this.SendProfiler = new NetickProfiler("NetworkSend");
    this.ReceiveProfiler = new NetickProfiler("NetworkReceive");
    this.ProcessStateChangesProfiler = new NetickProfiler("NetworkProcessChanges");
    this.TickProfiler = new NetickProfiler("NetworkTick");
    this.GameEngineIntoNetcodeProfiler = new NetickProfiler("GameEngineIntoNetcode:Callbacks");
    this.NetcodeIntoGameEngineProfiler = new NetickProfiler("Rollback:NetcodeIntoGameEngine:Callbacks");
    this.ResimulateProfiler = new NetickProfiler("Resimulate:NetworkFixedUpdate:Callbacks");
    this.UpdateProfiler = new NetickProfiler("NetworkUpdate:Callbacks");
    this.FixedUpdateProfiler = new NetickProfiler("NetworkFixedUpdate:Callbacks");
    this.RenderProfiler = new NetickProfiler("NetworkRender:Callbacks");
  }
}
